#ifndef MARROW_H
#define MARROW_H
#include <QGraphicsLineItem>
#include "mprocess.h"

QT_BEGIN_NAMESPACE
class QGraphicsPolygonItem;
class QGraphicsLineItem;
class QGraphicsScene;
class QRectF;
class QGraphicsSceneMouseEvent;
class QPainterPath;
QT_END_NAMESPACE

class mArrow : public QGraphicsLineItem
{
    //Q_OBJECT

public:
    mArrow(mProcess *startItem, mProcess *endItem, int id, QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    //~mArrow();

    enum { Type = UserType + 4 };

    int type() const
        { return Type; }

    QRectF boundingRect() const;

    QPainterPath shape() const;

    void setColor(const QColor &color)
        { myColor = color; }

    mProcess *startItem() const
        { return myStartItem; }

    mProcess *endItem() const
        { return myEndItem; }

    int GetMyID() const{
        return myID;}

public slots:
    void updatePosition();

protected:
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
               QWidget *widget = 0);

private:
    mProcess *myStartItem;
    mProcess *myEndItem;
    QColor myColor;
    QPolygonF arrowHead;
    int myID;

};


#endif // MARROW_H
